package com.smartplatform.controller;

import com.smartplatform.dto.R;
import com.smartplatform.pojo.SysMenu;
import com.smartplatform.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 咕唧
 * @Date 2022/5/31 20:19
 * @Version 1.0
 */
@RestController
@RequestMapping("/menus")
public class SysMenuController {
    private SysMenuService sysMenuService;

    @Autowired
    public void setSysMenuService(SysMenuService sysMenuService) {
        this.sysMenuService = sysMenuService;
    }

    @GetMapping("/menus")
    public R findAllMenus() {
        List<SysMenu> menuList = sysMenuService.findAll();
        return R.setOK(menuList);
    }
}
